package com.aihuishou.monitor.model;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

@Data
public class DefaultMessageTree {
    public DefaultMessageTree() {
    }

    public DefaultMessageTree(Message root) {
        this.root = root;
    }

    private Message root;

    /**
     * 从root里面解析出，Transaction
     * Transaction里面不会挂childList
     */
    private List<Transaction> transactionList;

    /**
     * 从root里面解析出，Event
     */
    private List<Event> eventList;

    public List<Transaction> getTransactionList() {
        if (transactionList == null) {
            transactionList = new ArrayList<>();
        }
        return transactionList;
    }

    public List<Event> getEventList() {
        if (eventList == null) {
            eventList = new ArrayList<>();
        }
        return eventList;
    }
}
